package com.communal.service;

import com.communal.model.Model;
import com.communal.util.AppException;
import com.communal.web.form.UserInfoForm;

/**
 * Define operations for user registration, changing user profile e.t.s <br>
 * @author Created by andrey.kuznetsov <br>
 * @author Last modified by $Author$ <br>
 * @author Last modified on $Date$ at revision $Revision$ <br>
 */
public interface IUserService {

	/**
	 * Returns model for current logged user <br>
	 * @return user model - {@link Model} <br>
	 * @throws AppException - if exception was occurred
	 */
	public Model getModelForCurrentLoggedUser() throws AppException;
	
	/**
	 * Returns form with user detailed information <br>
	 * @return {@link UserInfoForm} <br>
	 * @throws AppException - if exception was occurred
	 */
	public UserInfoForm getUserInfoForCurrentLoggedUser() throws AppException;
	
	/**
	 * Registers new user in system <br>
	 * @param p_login - user login; {@link String} <br>
	 * @param p_password - user password; {@link String} <br>
	 * @param p_firstName - user first name; {@link String} <br>
	 * @param p_lastName - user last name; {@link String} <br>
	 * @throws AppException - if exception was occurred
	 */
	public void registerNewUser(String p_login, String p_password, String p_firstName, String p_lastName) throws AppException;

	/**
	 * Save user profile <br>
	 * @param p_id - unique id of user in database <br>
	 * @param p_login - user login; {@link String} <br>
	 * @param p_password - user password; {@link String} <br>
	 * @param p_firstName - user first name; {@link String} <br>
	 * @param p_lastName - user last name; {@link String} <br>
	 * @throws AppException - if exception was occurred
	 */
	public void saveUserProfile(Integer p_id, String p_login, String p_password, String p_firstName, String p_lastName) throws AppException;
}
